#!D:\Python27\python.exe
# -*- coding: utf-8 -*-
'''
    Logout Request Command

    :copyright: (c) 2014 by Duxin.
'''

import cgi

import command
import app
import sessions
from db.db_manager import UserDAO, User
from exception import ParameterError

class Logout(command.Command):
    def is_param_right(self):  
        pass  

    def execute(self):
        session = self.get_session()
        
        user = session.get_attribute('user')

        if user:
            session.del_attribute('user')
            return "success"
        else:
            return "error_用户未登录"

app.App.start(Logout())
